package Java.com;

public class MyRunnable implements Runnable {
	private volatile boolean active;

	public void run() {
		active = true;
		while (active) { // line 1
			// some code here
		}
	}

	public void stop() {
		active = false;// line 2
	}
}